﻿<%@ Page Language="C#" AutoEventWireup="true" Inherits="WorkFlow_WFDesigner_FlowPaint" ValidateRequest="false" Codebehind="FlowPaint.aspx.cs" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns:v="urn:schemas-microsoft-com:vml" >
<head id="Head1" runat="server">
<title>流程图</title>
<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE7" />
<link href="../css/tooltip/style.css" type="text/css" rel="Stylesheet" />
<link href="../../Styles/control.css" type="text/css" rel="Stylesheet" />
<link href="inc/style.css" type="text/css" rel="Stylesheet" />
<script language="javascript" type="text/javascript"  src="inc/contextMenu/context.js"></script>
<script language="javascript" type="text/javascript"  src="inc/webflow.js"></script>
<script language="javascript" type="text/javascript"  src="inc/function.js"></script>
<script language="javascript" type="text/javascript"  src="inc/movestep.js"></script>
<script language="javascript" type="text/javascript"  src="inc/flowTool.js"></script>
<script language="javascript" type="text/javascript"  src="../Scripts/jquery-1.4.1.js"></script>
<style type="text/css">
.borderShow
{
    border:1px solid #BABABA;cursor:hand;
}
</style>
<script language="javascript" type="text/javascript" >
function getQry(key){ 
    var search=location.search.slice(1);
    var arr=search.split("&"); 
    for(var i=0;i<arr.length;i++){ 
        var ar=arr[i].split("="); 
        if(ar[0]==key){ 
            return ar[1]; 
        } 
    } 
} 
var Status="";
var IsUpdate="";
var IsFrist="1";
var TemplateType="";
//编辑流程属性
function mEditFlow()
{
    var dialog =window.showModalDialog('JobTemplateEdit.aspx?ID='+FlowID, window, "dialogWidth:560px; dialogHeight:400px; center:yes; help:no; resizable:no; status:no") ;
    if(dialog != null)
    {
        alert(dialog);
    }
}
//编辑节点
function mEditNode(nodeid,actType,width,height)
{
    var dialog = window.showModalDialog('NodeEdit.aspx?JobTemplateID='+FlowID+"&ID="+nodeid+"&ActType="+actType, window, "dialogWidth:"+width+"px; dialogHeight:"+height+"px; center:yes; help:no; resizable:no; status:no") ;
    if(dialog != null)
    {
        alert(dialog);
        loadFlow();
    }    
}
//编辑连接线
function mEditLine(lineid)
{
    var dialog = window.showModalDialog('LineEdit.aspx?JobTemplateID='+FlowID+"&ID="+lineid, window, "dialogWidth:560px; dialogHeight:300px; center:yes; help:no; resizable:no; status:no") ;
    if(dialog != null)
    {
        alert(dialog);
        loadFlow();
    }
}
function loadFlow()
{
    $.ajax({
        type: "POST",
        url: "JSON/Flow.ashx",
        data: "ActionType=0&FlowID=" + FlowID,
        success: function (msg) {
            FlowXML.value = msg;
        }
    });
}
function mAutoUpdateFlow()
{
    if(!window.confirm("重新生成流程图可能会破坏当前流程图布局，是否确定要进行此操作？"))
    {
        return;
    }
    window.showModalDialog('AutoUpdateFlow.aspx?ID='+FlowID, window, "dialogWidth:0px; dialogHeight:0px; center:yes; help:no; resizable:no; status:no") ;
    loadFlow(FlowID);
}
function mActiveFlow()
{
    mChangedFlowStatus('1');
}
function mCancelFlow()
{
    mChangedFlowStatus('2');
}
function mResumeFlow()
{
    mChangedFlowStatus('3');
}
function mChangedFlowStatus(obj)
{    
    var StrUrl=escape('FlowStatusEdit.aspx?ID='+FlowID+'&Status='+obj);
    var retValue = showModalDialog('PreLoad.htm?url='+StrUrl,window,'dialogWidth:500px; dialogHeight:350px; center:yes; help:no; resizable:no; status:no')
    if(retValue == true)
    {
        var id="";
        if(obj== "1"){
            id="100102";
        }
        else if(obj== "2"){
            id="100103";
        }
        else if(obj== "3"){
            id="100102";
        }
        document.location.href='../WFConfigure/WFFlowList.aspx?ID='+id+'&WFModule=4';
    }
}
function mSetLayout()
{
//    btnActive.style.display = "none";
//    btnResume.style.display = "none";
//    btnCancel.style.display = "none";
//    
//    if(Status == '100102'){//运行
//        btnAddMunualNode.style.display = "none";
//        btnAddDecisionNode.style.display = "none";
//        btnAddCoalitionNode.style.display = "none";
//        btnAddLine.style.display = "none";        
//    }
//    else if(Status == '100103'){
//        btnAddMunualNode.style.display = "none";
//        btnAddDecisionNode.style.display = "none";
//        btnAddCoalitionNode.style.display = "none";
//        btnAddLine.style.display = "none";
//        
//    }
//    if(TemplateType == '102601')//直线流程
//    {
//        btnAddDecisionNode.style.display = "none";
//        btnAddCoalitionNode.style.display = "none";
//    }
}
function InitQry()
{
    FlowID = getQry('ID');
    Status=getQry('Status');
    IsUpdate=getQry('IsUpdate');
    TemplateType=getQry('TemplateType');
}
</script>
<style type="text/css">
v\:* { Behavior: url(#default#VML) }
body
{
    background-color:White;margin:0;
}
</style>
</head>

<body  onload="InitQry();mSetLayout();loadFlow();initialize();" oncontextmenu="clearCursor();cleancontextMenu();return false;" scroll="auto">
<div id="msgbox"></div>
<input type="hidden" name=FlowXML onpropertychange='if(AUTODRAW) redrawVML();' />
<table cellspacing="0" cellpadding="0" border="0">
	<tr>
	    <td  width="1600" height="1000" onclick="cleancontextMenu();addFlowObj();clearCursor();return false;" oncontextmenu='clearCursor();return false;' valign=top align=left>
            <v:group ID="FlowVML"  style="left:193;top:28;width:1600px;height:1000px;position:absolute;" coordsize="4000,4000">
	     
           </v:group>
	    </td>
	</tr>			
</table>
</body>
</html>